import request from '@/request/request'

// 获取仓库列表
export function getWarehouseList() {
    return request({
        method: "get",
        url: '/warehouse/list',
    })
}

// 创建仓库
export function createWarehouse(warehouse) {
    return request({
        method: "post",
        url: '/warehouse',
        data: warehouse
    })
}

// 更新仓库
export function updateWarehouse(warehouse) {
    return request({
        method: "put",
        url: '/warehouse',
        data: warehouse
    })
}

// 删除仓库
export function deleteWarehouse(id) {
    return request({
        method: "delete",
        url: `/warehouse/${id}`,
    })
}

// 分页获取库存
export function getStockPage(pageParams) {
    return request({
        method: "get",
        url: '/warehouse/stock/page',
        params: pageParams
    })
}

// 获取产品列表
export function getProductList() {
    return request({
        method: "get",
        url: '/warehouse/products',
    })
} 